<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" lang="zh-CN">
    <title>What's for dinner</title>
    <style>
        canvas {
            border: 1px solid #000;
        }
    </style>
</head>

<body>
    <div id="main">
        <div id="title">今晚吃什么</div>
        <div id="maintitle">
            <input id="conclu" value="？" readonly="readonly"></input>
        </div>
        <div id="maintitle">
            <button onclick="genearate()">点我</button>
        </div>
    </div>
</body>

</html>

<script>
    function genearate() {
        var items = ['麻辣烫', '麻辣拌', '鸡公煲', '渤海', '打卤面',
            '辣子鸡', '羊汤', '二小', '食堂', '食堂', '食堂', '食堂'
        ]
        var randomItem = items[Math.floor(Math.random() * items.length)];
        console.log(randomItem);
        var input = document.getElementsByTagName("conclu");
        conclu.value = randomItem;
    }
</script>

<style>
    @media screen and (max-width: 1024px) {
        html {
            font-size: 2vw;
            color: #333333;
        }
        body {
            position: relative;
            margin: 0;
            padding: 0;
            width: 100vw;
            height: 100vh;
        }
        #main {
            border: 2px solid #333333;
            margin: 6px;
            padding: 6px;
            background: #f8f8f8;
            /* margin-top: 10vh; */
            padding-top: 30vh;
            padding-bottom: 30vh;
            top: 50%;
        }
        #title {
            font-size: 4rem;
            line-height: 10rem;
            text-align: center;
        }
        #maintitle {
            text-align: center;
            margin-top: 6px;
            font-size: 0px;
        }
        #maintitle input {
            border: none;
            border-bottom: #666666 2px solid;
            padding: 10px 0 0 0;
            line-height: 10rem;
            margin: 0px 6px 0 6px;
            font-size: 4.5rem;
            background: #f8f8f8;
            color: #333333;
            text-align: center;
            width: 70%;
        }
        #maintitle button {
            border: 0;
            padding: 30px 100px 30px 100px;
            margin-top: 30px;
            vertical-align: top;
            font-size: 3.4rem;
            background: #454545;
            color: #efefef;
        }
    }
    
    @media screen and (min-width: 1024px) {
        html {
            font-size: 1.3vw;
            color: #333333;
        }
        body {
            margin: 0;
        }
        #main {
            border: 2px solid #333333;
            margin: 20px;
            padding: 20px;
            background: #f8f8f8;
        }
        #title {
            font-size: 1.9rem;
            line-height: 1.9rem;
            text-align: center;
        }
        #maintitle {
            text-align: center;
            margin-top: 20px;
            font-size: 0px;
        }
        #maintitle input {
            border: none;
            border-bottom: #666666 2px solid;
            margin: 0px 20px 0 20px;
            vertical-align: baseline;
            font-size: 1rem;
            background: #f8f8f8;
            color: #333333;
            text-align: center;
            min-width: 20%;
        }
        #maintitle button {
            border: 0;
            padding: 5px 15px 5px 15px;
            margin: 0;
            vertical-align: top;
            font-size: 0.75rem;
            background: #454545;
            color: #efefef;
        }
    }
</style>
